home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cpptut22
/
clock.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-19
|
447b
|
28 lines
#include <stdio.h>
#include "clock.h"
clock::clock(void)
{
hour = 8;
minute = 51;
}
void clock::inc_and_print_time(void)
{
minute++; // Add one minute to the time
if (minute > 59) {
minute -= 60;
hour++;
}
// Output the user prompt
printf("\n It is now %d:", hour);
printf("%02dam", minute);
printf(", what do you wish to do? ");
}